package com.linq.cool.beauty.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.linq.cool.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: yqlin
 * @Date: 2021/2/2 22:37
 * @Description: 客户充值日志表
 * @Version: 1.0.0
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "beauty_top_up")
public class BeautyTopUp extends BaseEntity {
    /**
     * 充值订单号
     */
    @TableId(value = "id", type = IdType.INPUT)
    private String id;


    /**
     * 客户(会员)id(冗余处理)
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "member_id")
    private Long memberId;

    /**
     * 客户(会员)手机号(冗余处理)
     */
    @TableField(value = "member_phone")
    private String memberPhone;

    /**
     * 客户(会员)真实姓名(冗余处理)
     */
    @TableField(value = "member_real_name")
    private String memberRealName;

    /**
     * 支付时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "pay_time")
    private Date payTime;

    /**
     * 支付类型0现金1支付宝  字典表	beauty_top_up_pay_type
     */
    @TableField(value = "pay_type")
    private Integer payType;

    /**
     * 平台交易ID 如果是现金，则为空
     */
    @TableField(value = "pay_platform_id")
    private String payPlatformId;

    /**
     * 充值金额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 未完全退费的时候 会有剩余费用 也就是 status=5
     */
    @TableField(value = "rest_amount")
    private BigDecimal restAmount;

    /**
     * 订单状态0未支付  1 支付成功  2支付超时 3支付失败 4:已退费 字典表beauty_top_up_status
     */
    @TableField(value = "`status`")
    private Integer status;
}